package com.dwxt.mall.service;

import com.dwxt.mall.entity.PayOrder;
import com.dwxt.mall.service.feign.SocketService;
import com.dwxt.mall.service.feign.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class AsyncService {

    @Autowired
    private SocketService socketService;

    @Autowired
    private UserService userService;

    //@Async("myExecutor")
    public void reply(PayOrder order) {
        socketService.reply("mall", order.getId(), order.getSupplierId().toString());
    }

    public void hit(String id) {
        userService.hit("商品", id);
    }
}
